package com.constant;

import lombok.Getter;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Objects;
@Getter
public enum  OriginEnum {
    JINXIUJIAQI("jinxiujiaqi","锦秀假期"),
       ;
    private String code;
    private String name;

    OriginEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }
    public static OriginEnum codeOf(String code){
        if(StringUtils.isEmpty(code)){
            return null;
        }
        for(OriginEnum v:values()){
            if(Objects.equals(code,v.getCode())){
                return v;
            }
        }
        return null;
    }
}
